<template>
  <div id="order-list">
    <c-title text="客户列表"></c-title>
    <div class="search-box">
      <div class="input-box">
        <i class="iconfont icon-a-icon_pressed"></i>
        <input type="text" placeholder="搜索会员信息/昵称/手机号" @input="searchData" v-model="keyword" @keyup="searchData"/>
      </div>
    </div>
    <d-list :loading="loading" :finished="finished" @load="onLoad" >
      <div class="detail" v-for="(item,index) in dataList" :key="index">
        <div class="top-list">
          <div class="left-list">
            <img :src="item.avatar_image" alt="">
            <div class="name-row">
              <div class="name-low">
                <span class="name">{{item.username}}</span>
                <span class="id">{{item.uid}}</span>
              </div>
              <div class="time">注册时间：{{item.createtime}}</div>
            </div>
          </div>
          <van-icon name="arrow-up" v-show="!item.ishow" @click="clickShow(index,true)"/>
          <van-icon name="arrow-down" v-show="item.ishow" @click="clickShow(index,false)"/>
        </div>
        <div class="bottom-list" v-if="!item.ishow">
          <div class="num" @click="gotoCustomerList(item.uid)">客户数量：{{item.group_count}}个</div>
          <div class="num">客户订单数量：{{item.group_order_count}}个</div>
          <div class="num">订单数量：{{item.self_order_count}}个</div>
          <div class="num">客户订单总额：{{item.group_order_money}}元</div>
          <div class="num">订单总额：{{item.self_order_money}}元</div>
        </div>
      </div>
    </d-list>
  </div>
</template>
<script>
import list_controller from "./list_controller.js";

export default list_controller;
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#order-list {
  padding-bottom: 0.4rem;
  .search-box {
    width: 100%;
    background: #fff;
    padding: 0.625rem 0.9375rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: solid 0.0625rem #ebebeb;

    .input-box {
      width: 100%;
      height: 1.875rem;
      border-radius: 1rem;
      background: #f5f5f5;
      padding: 0 0.625rem;
      display: flex;
      align-items: center;

      .iconfont {
        font-size: 1rem;
        margin: 0.1rem 0.2rem 0 0;
        color: #999;
      }

      input {
        width: 100%;
        border: none;
        margin-left: 0;
      }
    }
  }
  .detail {
    background: white;
    padding: 0.8rem 0.8rem 0 0.8rem;
    margin: 0.8rem;
    border-radius: 0.4rem;
    .top-list {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 0.8rem;
      .left-list {
        display: flex;
        align-items: center;
        img {
          width: 2.3rem;
          height: 2.3rem;
          border-radius: 50%;
        }
        .name-row {
          text-align: left;
          margin-left: 0.6rem;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          height: 2.7rem;
          .name-low {
            .name {
              font-size: 0.95rem;
              font-weight: bold;
              color: #3B3B4A;
            }
            .id {
              background: rgba(241, 83, 83, 0.1);
              border-radius: 0.5rem;
              font-size: 0.8rem;
              color: #F15353;
              padding: 0.05rem 0.2rem;
              margin-left: 0.3rem;
            }
          }
          .time {
            font-size: 0.85rem;
            color: #AAAAB3;
          }
        }
      }
      .van-icon {
        color: #AAAAB3;
        font-size: 0.85rem;
      }
    }
    .bottom-list {
      display: flex;
      flex-wrap: wrap;
      border-top: 0.1rem solid #ECECEC;
      padding-top: 0.8rem;
      .num {
        font-size: 0.8rem;
        font-weight: 400;
        color: #6E6E79;
        width: 50%;
        text-align: left;
        margin-bottom: 0.8rem;
        line-height: 1;
      }
    }
  }
}
</style>
